﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace Pixysoft.Tools
{
    public class ConsoleHelper
    {
        /// <summary>
        /// http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/701e02cc-ad77-46b9-b4fc-410bb3ff7a0d
        /// </summary>
        /// <returns></returns>
        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool AllocConsole();

        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool FreeConsole();
    }
}
